import log4js from 'log4js'

log4js.configure({
    appenders: {
        console: {
            type: 'console'
        },
        out: { type: 'file', filename: 'logs/pm2logs.log' }
    },
    categories: {
        default: { appenders: ['out', 'console'], level: 'info' }
    },
    pm2: true,
});
const logger = log4js.getLogger(); // app为集群名称
logger.info("I'm forever blowing bubbles ");
logger.info("I'm forever blowing bubbles ");
logger.info("I'm forever blowing bubbles ");
logger.info("I'm forever blowing bubbles ");
logger.info('last bubbles');
// give pm2 time to set everything up, before we tear it down
setTimeout(() => {
    log4js.shutdown(() => {
        console.error('All done, shutdown cb returned.');
    });
}, 5000);